using EmployeesManager.Poco;

namespace Employeesmanager.DataAccessEF.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<Employeesmanager.DataAccessEF.EmployeesContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
        }

        protected override void Seed(Employeesmanager.DataAccessEF.EmployeesContext context)
        {
            context.Employees.AddOrUpdate(
                p => p.Id,
                new Employee
                    {
                        Id=1,
                        Age = 43,
                        Name = "Hary",
                        Salary = 20000,
                        Title = "CEO"
                    },
                new Employee
                    {
                        Id = 2,
                        Age = 35,
                        Name = "Thomas",
                        Salary = 5000,
                        Title = "Sales Manager",
                        ManagerId= 1,
                    },
                new Employee
                    {
                        Id = 3,
                        Age = 23,
                        Name = "Henry",
                        Salary = 12000,
                        Title = "Sales Person",
                        ManagerId = 2,
                    },
                new Employee
                    {
                        Id = 4,
                        Age = 33,
                        Name = "John",
                        Salary = 8000,
                        Title = "Technical Manager",
                        ManagerId = 1,
                    },
                new Employee
                    {
                        Id = 5,
                        Age = 31,
                        Name = "Steve",
                        Salary = 5000,
                        Title = "Technical Lead",
                        ManagerId = 4,
                    });
        }
    }
}